package me.shingohu.man.intergation;

import org.greenrobot.eventbus.EventBus;

import me.shingohu.man.model.bean.SimpleEvent;

/**
 * Created by hujie on 17/4/14.
 */

public class EventManager {
    private static EventManager eventMamager;
    private EventBus eventBus;

    public static EventManager getInstance() {
        if (eventMamager == null) {
            eventMamager = new EventManager();
        }
        return eventMamager;
    }

    private EventManager() {
        eventBus = EventBus.getDefault();
    }

    public void postIntEvent(int type, int intEvent) {
        eventBus.post(new SimpleEvent(type, intEvent));
    }

    public void postStringEvent(int type, String strEvent) {
        eventBus.post(new SimpleEvent(type, strEvent));
    }

    public void postObjEvent(int type, Object objectEvent) {
        eventBus.post(new SimpleEvent(type, objectEvent));
    }

    public void postEvent(int type) {
        eventBus.post(new SimpleEvent(type));
    }

    public void postStickyEvent(int type) {
        eventBus.postSticky(new SimpleEvent(type));
    }


    public void post(SimpleEvent event) {
        eventBus.post(event);
    }


}


